package com.ahcg

class AssociatedDemo {
  private val a: Int = 10;
  private var b: Int = 2;
}

object AssociatedDemo {
  val object_v1: String = "变量1";

  def main(args: Array[String]): Unit = {
    // 注：只有伴生对象中可以定义主函数，类似于static修饰
    println("伴生对象变量:" + object_v1);
    println("伴生类变量:" + new AssociatedDemo().a);
  }
}
